package com.kischang.blog.service;

import com.kischang.blog.dao.TitleMenuDao;
import com.kischang.blog.model.TitleMenu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Component
public class TitleMenuService {
	@Autowired
	private TitleMenuDao dao;
	
	@Transactional(readOnly=true)
	public List<TitleMenu> getAllParentMenu(){
		return dao.getAllParentMenu();
	}

	@Transactional(readOnly=true)
	public TitleMenu getTitleMenuByName(String name){
		return dao.getTitleMenuByName(name);
	}

	@Transactional(readOnly=true)
	public TitleMenu getMenuById(int mid) {
		return dao.getMenuById(mid);
	}
	
}
